package com.fate.system.dto.filepartdetail;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Author: ten.x @TableName file_part_detail @Date: 2024-05-20 00:06:47 @Version: V1.0
 */
@Data
@Accessors(chain = true)
@TableName(value = "file_part_detail")
@EqualsAndHashCode(callSuper = false)
public class FilePartDetailUpdateDTO implements Serializable {

  @Serial
  @TableField(exist = false)
  private static final long serialVersionUID = 1L;

  /** 主键：id */
  @TableId
  @Schema(description = "id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String id;

  /** 存储平台 */
  @Size(max = 32, message = "编码长度不能超过32")
  @TableField(value = "platform")
  @Schema(description = "存储平台")
  @Length(max = 32, message = "编码长度不能超过32")
  private String platform;

  /** 上传ID，仅在手动分片上传时使用 */
  @Size(max = 128, message = "编码长度不能超过128")
  @TableField(value = "upload_id")
  @Schema(description = "上传ID，仅在手动分片上传时使用")
  @Length(max = 128, message = "编码长度不能超过128")
  private String uploadId;

  /** 分片 ETag */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "e_tag")
  @Schema(description = "分片 ETag")
  @Length(max = 255, message = "编码长度不能超过255")
  private String eTag;

  /** 分片号。每一个上传的分片都有一个分片号，一般情况下取值范围是1~10000 */
  @TableField(value = "part_number")
  @Schema(description = "分片号。每一个上传的分片都有一个分片号，一般情况下取值范围是1~10000")
  private Integer partNumber;

  /** 文件大小，单位字节 */
  @TableField(value = "part_size")
  @Schema(description = "文件大小，单位字节")
  private Double partSize;

  /** 哈希信息 */
  @TableField(value = "hash_info")
  @Schema(description = "哈希信息")
  private String hashInfo;

  /** 创建时间 */
  @TableField(value = "create_time")
  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime createTime;
}
